package com.af.robot.exception;


import com.af.robot.result.ResultEnum;

/**
 * @ClassName CustomerException
 * @Description 项目自定义异常
 * @Auth
 * @Date 2019/6/20 9:39
 * @Version 1.0
 **/
public class CustomerException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     **/
    private Integer code;

    public Integer getCode() {
        return code;
    }

    public CustomerException() {
    }

    public CustomerException(ResultEnum resultEnum) {
        super(resultEnum.getMsg());
        this.code = resultEnum.getCode();
    }

    public CustomerException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public CustomerException(int code) {
        this.code = code;
    }

}
